<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>鼠标事件</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
            background: peru;
        }
    </style>
</head>
<body>
    <div class="box"></div>

    <script>
        // 鼠标事件类型
        const box = document.querySelector('.box')
        
        // 1、鼠标点击
        box.addEventListener('click',function() {
            box.style.background = 'pink'
        })

        // 2、鼠标经过
        box.addEventListener('mouseenter',function() {
            box.style.borderRadius ='50%'
            box.style.transition = 'all 1s'
        })

        // 3、鼠标离开
        box.addEventListener('mouseleave',function(){
            box.style = 'width: 200px;height: 200px;background: peru;'
            box.style.borderRadius ='0%'
            box.style.transition = 'all 1s'
        })

    </script>
</body>
</html>